package com.fxm.client;

import com.fxm.config.feign.QuestionFeignConfig;
import com.fxm.returns.RespEntity;
import com.fxm.returns.RespTable;
import com.fxm.vo.param.QuestionParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author fxm
 * @version V1.0.0
 * @description: 题目管理 feign调用
 * @date 2021/02/20 17:29
 */
@FeignClient(name = "questionFeignClient", url = "${manage.url}", configuration = QuestionFeignConfig.class)
public interface QuestionClient {
    /**
     * 题目列表
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/question/list")
    RespTable questionList(@RequestParam("page") Integer page,
                           @RequestParam("limit") Integer limit);

    /**
     * 搜索题目
     * @param page
     * @param limit
     * @param questionTitle
     * @return
     */
    @GetMapping("/question/list")
    RespTable searchQuestion(@RequestParam("page") Integer page,
                             @RequestParam("limit") Integer limit,
                             @RequestParam("questionTitle") String questionTitle);

    /**
     * 添加题目
     * @param questionParam
     * @return
     */
    @PostMapping("/question/insert")
    RespEntity insertQuestion(@RequestBody QuestionParam questionParam);

    /**
     * 修改题目
     * @param questionParam
     * @return
     */
    @PutMapping("/question/update")
    RespEntity updateQuestion(@RequestBody QuestionParam questionParam);

    /**
     * 删除题目
     * @param id
     * @return
     */
    @DeleteMapping("/question/delete")
    RespEntity deleteQuestion(@RequestParam("id") Integer id);

    /**
     * 批量删除题目
     * @param ids
     * @return
     */
    @DeleteMapping("/question/batchDelete")
    RespEntity batchDeleteQuestion(@RequestParam("ids") Integer[] ids);

}
